<!--# layout("/common/layout.html",{"jsBase":"/js/customer/member/"}){ -->

<form class="layui-form layui-form-pane" id="addForm" enctype="multipart/form-data"  lay-filter="editform">
    <input type="hidden" name="customerId" id="customerId">
    <br>
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <div class="layui-inline">
                    <label class="layui-form-label">用户状态</label>
                    <div class="layui-input-inline">
                        <input type="radio" name="custStatus" value="1" title="启用">
                        <input type="radio" name="custStatus" value="0" title="禁用" checked>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
    Common.initImage();
layui.define([ 'form', 'laydate', 'table','memberApi'], function(exports) {
    var form = layui.form;
    var memberApi = layui.memberApi;
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                form.on('submit(form)', function(){
                    memberApi.updateStatus($('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });
            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }


    view.init();
    <!--# if(!(isEmpty(member))){  -->
    var formJson = ${member};
    form.val("editform",formJson);
    $(".image-preview").each(function() {
        $(this).attr("src",formJson[$(this).attr("id")]);
    });
    <!--# } -->
});
</script>
